projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d74dda0
)
powerpc/bootcount: Fix endianness problem
author
Michael Weiss
<
[email protected]
>
Thu, 20 May 2010 14:09:35 +0000
(16:09 +0200)
committer
Wolfgang Denk
<
[email protected]
>
Wed, 26 May 2010 20:26:32 +0000
(22:26 +0200)
For CONFIG_SYS_BOOTCOUNT_SINGLEWORD the code had an endianness problem.
Signed-off-by: Michael Weiss <
[email protected]
>
Signed-off-by: Detlev Zundel <
[email protected]
>
arch/powerpc/lib/bootcount.c
patch
|
blob
|
history
diff --git
a/arch/powerpc/lib/bootcount.c
b/arch/powerpc/lib/bootcount.c
index 6346527677f5a1f572d924cc9ae23da595642512..338c8486d70726bb2b8726c2464f46ee25e5e594 100644
(file)
--- a/
arch/powerpc/lib/bootcount.c
+++ b/
arch/powerpc/lib/bootcount.c
@@
-77,10
+77,12
@@
ulong bootcount_load(void)
void *reg = (void *)CONFIG_SYS_BOOTCOUNT_ADDR;
#if defined(CONFIG_SYS_BOOTCOUNT_SINGLEWORD)
- if (in_be16(reg + 2) != (BOOTCOUNT_MAGIC & 0xffff))
+ u32 tmp = in_be32(reg);
+
+ if ((tmp & 0xffff0000) != (BOOTCOUNT_MAGIC & 0xffff0000))
return 0;
else
- return
in_be16(reg
);
+ return
(tmp & 0x0000ffff
);
#else
if (in_be32(reg + 4) != BOOTCOUNT_MAGIC)
return 0;